window.onload = function(){
	
	var lists = document.getElementsByTagName('li');
	/*
	for(var i=0;lists.length>i;i++){
		(function(){
			var _index = i;
			lists[i].onclick = function(){console.log(_index);return false;};
		})();
	}
	*/
	
	var showWin = document.getElementById('showWin');
	var showWinImg = showWin.getElementsByTagName('img')[0];
	var audio = document.getElementById('audio');
	showWinImg.onclick = function(event){event.stopPropagation();return false;};
	showWin.onclick = function(){this.style.display = "none"};
	//lists[4].onclick = function(){showWin.style.display = "block";showWinImg.src="./img/chihe.png"};
	
	lists[7].onclick = function(){showWin.style.display = "block";showWinImg.src="./img/2dcode.jpg"};
	
	var train = document.getElementById('train');
	setTimeout(function(){train.style.left=0;train.style.width='100%';train.style.height='100%';audio.play();},500);
	
	var audio = document.getElementById('audio');
	audio.canplay = function(){audioAutoPlay('audio');};
	audioAutoPlay('audio');
	train.onclick = function(){audio.play();};
	showWinImg.onload = function(){audio.play()};
	
	function audioAutoPlay(id){
	    var audio = document.getElementById(id);
	    audio.play();
	    document.addEventListener("WeixinJSBridgeReady", function () {
	            audio.play();
	    }, false);
	}
	
	var flash = document.getElementById('flash');
	flash.style.top = window.innerWidth/720*300+'px';
	flash.style.left = window.innerWidth/720*50+'px';
	flash.style.width = window.innerWidth/720*480+'px';
	flash.style.height = window.innerWidth/720*100+'px';
	setTimeout(function(){flash.style.opacity=0.6},900);
	setTimeout(function(){flash.style.left=parseInt(flash.style.left)+parseInt(flash.style.width)+500+'px';flash.style.opacity=1;},1000);
	setTimeout(function(){flash.style.opacity=0.1;},1600);
};
